package com.osce.interfaces.score;

import com.baomidou.mybatisplus.extension.service.IService;
import com.csce.domain.entity.score.ScoreExExamPlaceAllot;
import com.csce.domain.entity.score.ScoreExExamSession;

import java.util.List;

/**
 * 考试分配学员Service接口
 *
 * @author zzx
 * @since 2023-09-07
 */
public interface IScoreExExamPlaceAllotService extends IService<ScoreExExamPlaceAllot> {

    /**
     * 查询考试分配学员
     *
     * @param id 考试分配学员主键
     * @return 考试分配学员
     */
    ScoreExExamPlaceAllot selectScoreExExamPlaceAllotById(Long id);

    /**
     * 查询考试分配学员列表
     *
     * @param scoreExExamPlaceAllot 考试分配学员
     * @return 考试分配学员集合
     */
    List<ScoreExExamPlaceAllot> selectScoreExExamPlaceAllotList(ScoreExExamPlaceAllot scoreExExamPlaceAllot);

    /**
     * 新增考试分配学员
     *
     * @param scoreExExamPlaceAllot 考试分配学员
     * @return 结果
     */
    int insertScoreExExamPlaceAllot(ScoreExExamPlaceAllot scoreExExamPlaceAllot);

    /**
     * 修改考试分配学员
     *
     * @param scoreExExamPlaceAllot 考试分配学员
     * @return 结果
     */
    int updateScoreExExamPlaceAllot(ScoreExExamPlaceAllot scoreExExamPlaceAllot);

    /**
     * 批量删除考试分配学员
     *
     * @param ids 需要删除的考试分配学员主键集合
     * @return 结果
     */
    int deleteScoreExExamPlaceAllotByIds(Long[] ids);

    /**
     * 删除考试分配学员信息
     *
     * @param id 考试分配学员主键
     * @return 结果
     */
    int deleteScoreExExamPlaceAllotById(Long id);


    /**
     * 新增考试分配学员信息
     */
    int insertScoreExExamPlaceAllot(List<ScoreExExamPlaceAllot> scoreExExamPlaceAllotList, Long sessionId);

    int deleteScoreExExamPlaceAllotBySessionId(Long id);

    int deleteScoreExExamPlaceAllotBySessionIds(Long[] ids);

    int insertScoreExExamPlaceAllotBySession(List<ScoreExExamSession> sessions);


    int clearUserIdsByExam(Long examId);

    List<String> selectCodeByExamIdGroupAndOrderByCode(Long id);

    int updateUserIdByExamIdAndCode(Long id, Long userId, String code);

    int planUserCountByExamId(Long examId);

    ScoreExExamPlaceAllot selectScoreExExamPlaceAllotBySession(String examId, String timeId, String placeId, String code);
}
